<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="OpenSocialClient,org.opensocial.client.core.OpenSocialClient,addFeature,callAsync,callBatch,callSync,checkFeature,initCallbackManager,initFeatureBook,registerCallback,removeFeature,unregisterCallback" name="keywords">
<title>org.opensocial.client.core.OpenSocialClient</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'OpenSocialClient - OpenSocial Actionscript 3.0 Client Library Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">OpenSocial Actionscript Client Library</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?org/opensocial/client/core/OpenSocialClient.html&amp;org/opensocial/client/core/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;OpenSocialClient</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class OpenSocialClient"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.opensocial.client.core</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class OpenSocialClient</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">OpenSocialClient <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Subclasses</td><td><a href="../jswrapper/JsWrapperClient.html">JsWrapperClient</a>, <a href="../restful/RestfulClient.html">RestfulClient</a></td>
</tr>
</table>
<p></p>
 The core abstract class of the OpenSocial AS3 Client Library.
 <p>
 This client lirary is for those developers who want to develop flash opensocial apps in
 ActionScript 3.0.
 </p>
 <p>
 It's aimed to have no dependency on which container it runs on. It only depents on the
 Standard OpenSocial Javascript API and Restful protocol. It is developed on Shindig based
 container.
 </p>
 <p>
 All opensocial data I/O and app control can be handled by this client. An app can simply include
 the <code>org.opensocial.client</code> package to the flash project and use this client to make
 the app social.
 </p>
 <p>
 This <code>OpenSocialClient</code> is just an abstract class. It has two sub classes:
 the <code>JsWrapperClient</code> and <code>RestfulClient</code>, which is the real working
 client. They share many interfaces for developers to reduce the learning and migration effort.
 </p>
  <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../jswrapper/JsWrapperClient.html" target="">JsWrapperClient</a>
<br>
<a href="../restful/RestfulClient.html" target="">RestfulClient</a>
</div>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#OpenSocialClient()">OpenSocialClient</a>()</div>
<div class="summaryTableDescription">
   Constructor of the client.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addFeature()">addFeature</a>(featureName:String, isAsync:Boolean, reqParser:Function = null, resParser:Function = null):void</div>
<div class="summaryTableDescription">
   Adds new feature to this client.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#callAsync()">callAsync</a>(featureName:String, callback:Function, ... params):void</div>
<div class="summaryTableDescription">
   Executes the feature asynchronously.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#callBatch()">callBatch</a>(requests:Dictionary, handler:Function):void</div>
<div class="summaryTableDescription">
   Executes batch request.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#callSync()">callSync</a>(featureName:String, ... params):*</div>
<div class="summaryTableDescription">
   Executes the feature synchronously.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#checkFeature()">checkFeature</a>(featureName:String):<a href="../core/Feature.html">Feature</a>
</div>
<div class="summaryTableDescription">
   Gets and checks the feature by its name.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#registerCallback()">registerCallback</a>(callbackName:String, callback:Function):void</div>
<div class="summaryTableDescription">
   Registers a callback handler on this client.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeFeature()">removeFeature</a>(featureName:String):<a href="../core/Feature.html">Feature</a>
</div>
<div class="summaryTableDescription">
   Removes the feature by its name.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#unregisterCallback()">unregisterCallback</a>(callbackName:String):void</div>
<div class="summaryTableDescription">
   Unregisters a callback handler from this client.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#initCallbackManager()">initCallbackManager</a>():void</div>
<div class="summaryTableDescription">
   Initializes the feature book.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#initFeatureBook()">initFeatureBook</a>():void</div>
<div class="summaryTableDescription">
   Initializes the feature book.</div>
</td><td class="summaryTableOwnerCol">OpenSocialClient</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="OpenSocialClient()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">OpenSocialClient</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function OpenSocialClient()</code><p>
   Constructor of the client.
   Initializes the feature book and callback manager.
   </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addFeature()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addFeature</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addFeature(featureName:String, isAsync:Boolean, reqParser:Function = null, resParser:Function = null):void</code><p>
   Adds new feature to this client.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">featureName</span>:String</code> &mdash; The feature name.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">isAsync</span>:Boolean</code> &mdash; Is async feature or not.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">reqParser</span>:Function</code> (default = <code>null</code>)<code></code> &mdash; A parser function to parse the request parameters.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">resParser</span>:Function</code> (default = <code>null</code>)<code></code> &mdash; A parser function to parse the response value.
   </td>
</tr>
</table>
</div>
<a name="callAsync()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">callAsync</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function callAsync(featureName:String, callback:Function, ... params):void</code><p>
   Executes the feature asynchronously.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">featureName</span>:String</code> &mdash; The name of the async feature.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">callback</span>:Function</code> &mdash; The callback to handle the response.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code>... <span class="label">params</span></code> &mdash; The request parameters.
      </td>
</tr>
</table>
</div>
<a name="callBatch()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">callBatch</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function callBatch(requests:Dictionary, handler:Function):void</code><p>
   Executes batch request.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">requests</span>:Dictionary</code> &mdash; request collection.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">handler</span>:Function</code> &mdash; The callback to handle the response.
      </td>
</tr>
</table>
</div>
<a name="callSync()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">callSync</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function callSync(featureName:String, ... params):*</code><p>
   Executes the feature synchronously.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">featureName</span>:String</code> &mdash; The name of the sync feature.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code>... <span class="label">params</span></code> &mdash; The request parameters
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code> &mdash; The response value.
   </td>
</tr>
</table>
</div>
<a name="checkFeature()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">checkFeature</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function checkFeature(featureName:String):<a href="../core/Feature.html">Feature</a></code><p>
   Gets and checks the feature by its name.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">featureName</span>:String</code> &mdash; The feature name to lookup.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../core/Feature.html">Feature</a></code> &mdash; 
                        The feature instance.
   
                        
                     </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash;   </td>
</tr>
</table>
</div>
<a name="initCallbackManager()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">initCallbackManager</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function initCallbackManager():void</code><p>
   Initializes the feature book. This method can be overriden by special initialization.
   </p></div>
<a name="initFeatureBook()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">initFeatureBook</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function initFeatureBook():void</code><p>
   Initializes the feature book. This method should be overriden for customizing features.
   </p></div>
<a name="registerCallback()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">registerCallback</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function registerCallback(callbackName:String, callback:Function):void</code><p>
   Registers a callback handler on this client.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">callbackName</span>:String</code> &mdash; The name or id of the callback.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">callback</span>:Function</code> &mdash; The callback function.
      </td>
</tr>
</table>
</div>
<a name="removeFeature()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeFeature</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeFeature(featureName:String):<a href="../core/Feature.html">Feature</a></code><p>
   Removes the feature by its name. This method is to customize the client for special containers.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">featureName</span>:String</code> &mdash; The feature name to remove.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../core/Feature.html">Feature</a></code> &mdash; 
                        The feature instance.
   
                        
                     </td>
</tr>
</table>
</div>
<a name="unregisterCallback()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">unregisterCallback</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function unregisterCallback(callbackName:String):void</code><p>
   Unregisters a callback handler from this client.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">callbackName</span>:String</code> &mdash; The name or id of the callback.
   </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">2010 OpenSocial</center>
</div>
</body>
</html>
<!--2010 OpenSocial-->
